package com.siyoumi.app.sys.service;

import com.siyoumi.app.sys.service.api_handle.ApiHandleAliyun;
import com.siyoumi.app.sys.service.api_handle.vo.VoApiSmsSend;
import com.siyoumi.exception.EnumSys;
import com.siyoumi.util.XReturn;
import com.siyoumi.validator.XValidator;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

//短信
@Slf4j
@Data
public abstract class ApiHandle {
    static public ApiHandle of(String type) {
        ApiHandle handle = null;
        switch (type) {
            case "aliyun":
                handle = new ApiHandleAliyun();
                break;
            default:
                XValidator.err(EnumSys.SYS.getR("类型未开发"));
        }

        return handle;
    }

    abstract public XReturn smsSend(VoApiSmsSend data); //发短信接口
}
